<com:TPanel id="PortletEditMode" Style="border-bottom: 1px solid black; margin: 0px 0px 0px 0px; text-align: right;">
	<com:TImageButton OnClick="MoveButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/page_next.gif" Text="<%[Move to another area%>" />
	<com:TImageButton OnClick="UpButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/page_up.gif" Text="<%[Move portlet up]%>" />
	<com:TImageButton OnClick="DownButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/page_down.gif" Text="<%[Move portlet down%>" />
	<com:TImageButton OnClick="PropertyButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/application_form.png" Text="<%[Properties]%>" />
	<com:TImageButton OnClick="DeleteButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/application_delete.png" Text="<%[Remove portlet]%>" Attributes.onclick="if(!confirm('<%= Prado::localize('Are you sure?') %>')) return false;" "/>
</com:TPanel>
<com:TPanel Id="NewsOptions" DefaultButton="SaveNewsOptions" GroupingText="<%[News options]%>">
	<table width="100%">
		<tr>
			<td><com:TCheckBox Id="Showheaders" Text="<%[Show headers only]%>" /></td>
		</tr>
		<tr>
			<td><%[Number of news pr. page]%>&nbsp;<com:TTextBox Id="ShowCount" Columns="2" /></td>
		</tr>
		<tr>
			<td><com:TLinkButton Id="SaveNewsOptions" CssClass="link-button" Text="<%[Save]%>" onClick="SaveNewsOptionsBtnClicked" /></td>
		</tr>
	</table>
	<br />
</com:TPanel>
<com:TPanel Id="pnlNews" GroupingText="<%[Latest news]%>">
	<com:TDataList
		ID="NewsDataList"
		DataKeyField="id"
		PageSize="10"
		AllowPaging="true"
		AllowCustomPaging="true"
		EnableViewState="true"
		OnEditCommand="editItem"
		OnCancelCommand="cancelItem"
		OnUpdateCommand="updateItem"
		OnDeleteCommand="deleteItem"
		HeaderStyle.CssClass="grid-header"
		HeaderStyle.Width="100%"
		ItemStyle.CssClass="grid-row1"
		ItemStyle.Width="100%"
		AlternatingItemStyle.CssClass="grid-row2"
		EditItemStyle.CssClass="grid-row-edit"
		SelectedItemStyle.CssClass="grid-row-selected"
		OnSelectedIndexChanged="selectItem"
		style="width: 100%;">
		<prop:HeaderTemplate>
			<table width="100%">
				<tr>
  					<td style="width:5%;">#</td>
	  				<td style="width:15%;"><%[Created]%></td>
  					<td style="width:15%;"><%[Expire]%></td>
  					<td style="width:40%;"><%[Subject]%></td>
		  			<td style="width:10%;"><%[By]%></td>
		  			<td style="width:15%;"><%[Cmd]%></td>
				</tr>
			</table>
		</prop:HeaderTemplate>
		<prop:ItemTemplate>
			<table width="100%">
				<tr>
					<td style="width:5%;"><com:TLinkButton Text=<%#$this->DataItem->id%> CommandName="select" /></td>
					<td style="width:15%;"><%# date('d-m-Y',$this->DataItem->created) %></td>
					<td style="width:15%;"><%# date('d-m-Y',$this->DataItem->expire) %></td>
					<td style="width:40%;"><%# $this->DataItem->subject %></td>
					<td style="width:10%;"><%# $this->TemplateControl->UserName($this->DataItem->createdby) %></td>
					<td style="width:15%;">
						<com:TLinkButton Text="<%[Edit]%>" CommandName="edit" />
						<com:TLinkButton Text="<%[Delete]%>" CommandName="delete" Attributes.onclick="if(!confirm('<%= Prado::localize('Are you sure?') %>')) return false;" />
					</td>
				</tr>
			</table>
		</prop:ItemTemplate>
		<prop:SelectedItemTemplate>
			<table border="0" width="100%">
				<tr>
					<td colspan="2" align="center" style="border-bottom: 1px solid black"><strong><%[Details]%></strong></td>
				</tr>
				<tr>
					<td style="width:15%;"><%[Created]%></td>
					<td><%# date('d-m-Y',$this->DataItem->created) %></td>
				</tr>
				<tr>
					<td><%[Created by]%></td>
					<td><%# $this->TemplateControl->UserName($this->DataItem->createdby) %></td>
				</tr>
				<tr>
					<td><%[Expire]%></td>
					<td><%# date('d-m-Y',$this->DataItem->expire) %></td>
				</tr>
				<tr>
					<td><%[Modified]%></td>
					<td><%# date('d-m-Y',$this->DataItem->modified) %></td>
				</tr>
				<tr>
					<td><%[Modified by]%></td>
					<td><%# $this->TemplateControl->UserName($this->DataItem->modifiedby) %></td>
				</tr>
				<tr>
					<td><%[Subject]%></td>
					<td><%#$this->DataItem->subject %></td>
				</tr>
				<tr>
					<td valign="top"><%[Body]%></td>
					<td><%#$this->DataItem->body %></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: right;" style="border-top: 1px solid black;">
						<com:TLinkButton Text="<%[Edit]%>" CommandName="edit" />
						<com:TLinkButton Text="<%[Delete]%>" CommandName="delete" Attributes.onclick="if(!confirm('<%= Prado::localize('Are you sure?') %>')) return false;" />
					</td>
				</tr>
			</table>
		</prop:SelectedItemTemplate>
		<prop:EditItemTemplate>
			<table border="0" width="100%">
				<tr>
					<td colspan="2" align="center" style="border-bottom: 1px solid black"><strong><%[Edit]%></strong></td>
				</tr>
				<tr>
					<td colspan="2"><com:TValidationSummary Display="Dynamic" ValidationGroup="edtnews" /></td>
				</tr>
				<tr>
					<td style="width:15%;"><%[Created]%></td>
					<td><%# date('d-m-Y',$this->DataItem->created) %></td>
				</tr>
				<tr>
					<td><%[Created by]%></td>
					<td><%# $this->TemplateControl->UserName($this->DataItem->createdby) %></td>
				</tr>
				<tr>
					<td><%[Expire]%></td>
					<td><com:TDatePicker Id="edtExpire" InputMode="DropDownList" TimeStamp=<%#$this->DataItem->expire %> /></td>
				</tr>
				<tr>
					<td><%[Modfied]%></td>
					<td><%# date('d-m-Y',$this->DataItem->modified) %></td>
				</tr>
				<tr>
					<td><%[Modified by]%></td>
					<td><%# $this->TemplateControl->UserName($this->DataItem->modifiedby) %></td>
				</tr>
				<tr>
					<td><%[Subject]%></td>
					<td><com:TTextBox Id="edtSubject" Columns="45" Text=<%#$this->DataItem->subject %> /><com:TRequiredFieldValidator ControlToValidate="edtSubject" ValidationGroup="edtnews" Display="Dynamic" Text="*" ErrorMessage="<%[You need to enter a subject.]%>" ControlCssClass="input-error1" /></td>
				</tr>
				<tr>
					<td style="width:15%;" valign="top"><%[Body]%></td>
					<td style="width:85%;">
						<com:PortalHtmlArea id="edtBody" CustomPluginPath="Application.Common.TinyMCE.plugins.*" Style="width:100%" Text=<%#$this->DataItem->body %> >
							<prop:Options>
								plugins: "advimage,advlink,table",
								theme: "advanced",
								theme_advanced_buttons3_add : "table",
								content_css : "<%=$this->Request->BaseUrl%>/themes/Portal/<%=$this->Application->Parameters['ThemeName']%>/style.css",
								body_class : "my_class",
								file_browser_callback : "tinyBrowser"
							</prop:Options>
						</com:PortalHtmlArea>
						<com:TRequiredFieldValidator ControlToValidate="edtBody" ValidationGroup="edtnews" Display="Dynamic" Text="*" ErrorMessage="<%[You need to enter a body.]%>" ControlCssClass="input-error1" />
					</td>
				</tr>
    	        <tr><td colspan="2"><hr /></td><tr>
				<tr>
					<td><com:TLinkButton CssClass="link-button" Text="<%[Save]%>" CommandName="update" ValidationGroup="edtnews" /></td>
					<td style="text-align: right;"><com:TLinkButton CssClass="link-button" Text="<%[Cancel]%>" CommandName="cancel" /></td>
				</tr>
			</table>
		</prop:EditItemTemplate>
	</com:TDataList>
</com:TPanel>
<br />
<com:TPanel Id="pnlAddNews" GroupingText="<%[Add news]%>" Defaultbutton="AddNews" style="width:100%;">
	<table width="100%" border=0>
		<tr>
			<td style="width:100%;" colspan="2"><com:TValidationSummary Display="Dynamic" ValidationGroup="news" /></td>
		</tr>
		<tr>
			<td style="width:15%;" style="text-align: right;"><com:TLabel Text="<%[Subject]%>" ForControl="Subject" /></td>
			<td>
				<com:TTextBox Id="Subject" Columns="45" />
				<com:TRequiredFieldValidator ControlToValidate="Subject" ValidationGroup="news" Display="Dynamic" Text="*" ErrorMessage="<%[You need to enter a subject.]%>" ControlCssClass="input-error1" />
			</td>
		</tr>
		<tr>
			<td style="width:15%;" style="text-align: right;"><%[Expire]%></td>
			<td><com:TDatePicker Id="Expire" TimeStamp=<%= (time() + (60 * 60 *24 *30)) %> Culture=<%#$this->Application->Culture %> InputMode="DropDownList"/></td>
		</tr>
		<tr>
			<td style="width:15%;text-align: right;" valign="top"><com:TLabel Text="<%[Body]%>" ForControl="Body" /></td>
			<td style="width:85%;">
				<com:PortalHtmlArea id="Body" CustomPluginPath="Application.Common.TinyMCE.plugins.*">
					<prop:Options>
						plugins: "advimage",
						theme: "advanced",
						file_browser_callback : "tinyBrowser"
					</prop:Options>
				</com:PortalHtmlArea>
				<com:TRequiredFieldValidator ControlToValidate="Body" ValidationGroup="news" Display="Dynamic" Text="*" ErrorMessage="You need to enter a body." ControlCssClass="input-error1" />
			</td>
		</tr>
		<tr>
			<td style="width:100%;" colspan="2"><com:TLinkButton Id="AddNews" ValidationGroup="news" CssClass="link-button" Text="<%[Save]%>" onClick="AddNewsBtnClicked" /></td>
		</tr>
	</table>
</com:TPanel>